<script setup>
import router from "./router.js";

const routerChange = (n) => {
  router.push(n);
};
</script>
<template>
  <h1>父组件</h1>
  <p>
    <button @click="routerChange('/one')">打开组件1</button> <br />
    <button @click="routerChange('/two')">打开组件2</button> <br />
    <button @click="routerChange('/two/three')">打开组件3</button>
  </p>
  <div>
    <router-view></router-view>
  </div>
</template>
